Multiple bug fixes and PostgreSQL support.

Fixed “server/sqlserver” mixup on agents, seeds and templates.
Added support for postgres on agents, seeds and templates.
Updated mail templates.