Refactored into many files

Uses fun javascript haxx (I didn't want to mandate the existance of some server
to view the document.)