support for saving and loading documents, lots of minor improvements, editor and viewer close to being complete