Mostly functional. Needs tests. Ready for some real reviewing.