Fix require and JSHint errors