Implement setting hostnames on machines

This is still untested code. Will try this tomorrow. But it should (TM) work.