start testing with JSHint, fix some errors