Added document import/export functionality. Fixed some file loading issues.