Adding JSHint and cleaned up code.