Moved to standalone script file
Added tests
Use data from JSON files
Moved some data to JSON-based