Initial version (not tested). Committing before large overhaul (like removing multiplexer code).
Compiling version backup