separate module from bin

Aaaand last PR I'll bother you with. This clears a path towards #7 
Interested in any thoughts about this approach!