Hostmasks: rewrite a whole bunch of stuff