Factor ioloop manager

Factor the ioloop management code of the KATCP server class into a separate class that can also be used by the proposed client reworks. Also includes other minor fixes discovered along the way.