closing legal gaps that allow defendants in serious crimes to avoid trial by being deemed incompetent