Added encodeToFile/decodeFromFile methods for JSON handling
Also updated the syntax to conform to PSR coding standards/style