Added JSHint style checking, fixed some style issues.