Refactored channel conversion

•Moved channel conversion into a separate function to make it more
apparent what was happening
•Adjusted a few functions to take variable length parameters
•Fixed a few tests that panic when the function they're testing returns
the wrong length slice