Cleaned up code for the updated code standard and updated to work with the latest rawphp/rawbase package.