Updated namespacing and template loading for parsing directly from php