Fix JSHint warnings, build distribution