Put shared methods into a separate file that is sourced for both Channel and Server.

WHY HAVE I NOT DONE THIS BEFORE.