code and comments cleanup; finilizing 'multi-document file' feature