JSHint fixes

JSHint now runs automatically and will error on more things. Fixed all the errors in source and tests, and enabled strict mode.