clean up for strict php

This is looking promising guys!

For dev purposes I have my php set up to show all errors. This unfortunately means that nothing worked out of the box, due to the messages breaking JSON responses and JS variables.
I fixed these while setting up Cosmo so I could have a play around out - there may be more underway - but I thought you might want to pull my changes in?

Big kiss