Reorganized BPDocument class file.