Splitting document and text parsing into two separate sections. Document parsing essentially done. Adding text rendering code.