Conversion to work with latest emoncms dev branch

Hello Nick

Here are the changes that should make it work with the dev branch. I have got it to a stage where it shows no errors and includes all the standard changes but it may still have some bugs, maybe best to test before merging this pull request.

I'm not entirely sure how to use mqtt, would there be a good subscribe example to try? which would get data into emoncms?

Thanks

Trystan