Fixed JSHint warnings
Updated JS documentation