Added JsonFile from Composer to make the script work on PHP 5.3.
Add a test, and a simple framework for adding more (input/output pairs)
Use PHP_EOL instead of \r\n.
Renamed script to omit .php extension, since it's self-executable