Extract project-specific logic out of the PresentationCompiler proxy.

Also added a factory method in the API.
Decouple watchdog from compiler proxy through Pub/Sub.

Also fix some NPEs during tests.