break out the contents of the crate in many separate files, yay

(some of the impl is still pretty nasty, mind you)