Some refactoring and more constant formatting.

Add jshintrc file. Clean up transition method to get ready for #21.