Added support for multiplexer, and added some testing code