restructuring subs a bit
Improving test coverage. Added nose