Fix pg_dump dollar quoting for extension templates.
Improve dependency tracking in between extension templates and extensions.