Renaming files
Cleaned up the code for clarity and added JSON tests.
Merge remote-tracking branch 'origin/master'