separate module from bin

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