Adds doc-blocks to all methods. Adjusts visibility of a few methods to contain references to $domain object built by parser.
PSR-2 fixes.