correct behavior for indent and outdent and enter inside lists on "keydown"

I had a hard time come up with the tests, but the code itself should be pretty good this time. It is completely re-written.