Emonhub minor code cleanup, enhancements and python3 support

Hello @TrystanLea @pb66 ,

I’ve done more work on the systemd support, and pushed the changes to my github repo.

I think using the systemd watchdog to restart the whole process is probably a better idea than restarting individual threads, since that keeps the code a bit simpler and is likely to be more reliable. New topic for that specific change here - RFC - systemd integration with watchdog support and restart on thread failure - I’d appreciate some testing, code review and feedback on this.

Tim.