extract classes into separate files in lib

make them testable
make unused modules obvious
make dependencies clear

make the task file *not* a giant

I actually have some real changes to make, but my face was hurting looking at that giant file so I had to break it apart.