Fix JShint errors; code style and formatting