Bug fixes.

This includes a couple bug fixes.

 1. I was calling an @optional delegate method without checking if the delegate implements it. This was added in one of my previous pull requests. Sorry!

 2. A bug in the delete-backward detection made it select the previous JSTokenButton when you deleted the last character, rather than when you hit delete and there were already no characters. Also my fault.