Clean up lots of stuff, add export. Ready for release 1.0