Move authorization checks out of the catalog

Prior to this patch, the Catalog performed authorization checks when users accessed
catalog object. The benefit of this approach was that authorization happened naturally
during analysis as objects were accessed. The downside is that it made the Catalog API
more complicated and resulted in propagation of AuthorizationExceptions anytime the
catalog was accessed. Ideally, the Catalog should just provide APIs for accessing
metadata.

With this change, the Catalog is no longer responsible for performing authorization
checks. Instead, the Analyzer keeps track of each privilege request and performs an
authorization step after analysis completes (either successfully or on error). If any
checks fail, an AuthorizationException is raised.

Change-Id: I199d5d2c276e7c963771be1782728b5603a01c67
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3625
Reviewed-by: Lenni Kuff <lskuff@cloudera.com>
Tested-by: jenkins
Changes to Mustache templates to change working directory

Change-Id: I9759a380baba6a0711cf7a3688e07740ae4bcd20
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3711
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: Henry Robinson <henry@cloudera.com>
Add flag to disable any memory pooling for debugging.

The things we do to reuse memory and minimize allocations reduces the
effectiveness of asan. This patch adds a startup flag (would only be
used for debugging) that disables the pooling. This means that allocations
are one to one with malloc/frees.

This found one bug in the pcsa UDA which conveniently proves its effectiveness.
Unfortunately, I doubt anyone is using that function.

Change-Id: Id13d22a5ebad4d31c298ccb237d83d5398799f39
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3301
Reviewed-by: Nong Li <nong@cloudera.com>
Tested-by: jenkins
Pass document root to Mustache

'Partial' templates (those that are referred to from other templates)
were not properly resolved relative to the working directory. This
change passes the webserver document root to the template library.

Change-Id: Ib1f4d72b86f33507214dfd14bd23593bf76a9857
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3712
Reviewed-by: Alex Behm <alex.behm@cloudera.com>
Tested-by: jenkins