Fix Cmd-left/right bug in Firefox on Mac OS X.

Firefox incorrectly goes back/forward in history instead of moving the cursor to
the beginning/end of the line when you press cmd-left/right on a mac. We now
override this to do the right thing.