Use more portable function to get hostname

This addresses #11