First bulk upload of code

This is the first major upload of code. Not exactly well tested, but it
should all be here!