Implementation for Issue #7: ChannelFactory

Please review the original issue #7 and this code. It looks like this pull request mistakenly contains some of the changes meant for issue #5 as well, and I seemed to botch up my user name :)