Fix & simplify the next/prev key logic

I broke the next/prev key logic when I added the input validation; since
$scope.multi is now a *copy* of a key, rather than an actual key, we
can't rely on looking it up in the keys[] array to determine the
most-recently selected key.