Cleaned up to pass JSHint
Added tests for json()
Passed json() tests