Cleaned up Code, 20 flags left

Continued cleaning up code with JSHint