wal_decoding: Log xl_running_xact's at a higher frequency than checkpoints are done

Logging information about running xacts more frequently is beneficial for both,
hot standby which can reach consistency faster and release some resources
earlier using this information, and future logical replication which can
initialize quicker using this.

Do so in the background writer which seems to be the best choice as its
regularly running and shouldn't be busy for too long without getting back into
its main loop.

Also mark xl_running_xact records as being relevant for async commit so the wal
writer writes them out soonish instead of possibly waiting a long time.
wal_decoding: Introduce the replication slot interface for resource reservation
wal_decoding: Introduce changeset extraction

This introduces several things:
* 'reorderbuffer' module which reassembles transactions from a stream of interspersed changes
* 'snapbuilder' which builds catalog snapshots so that tuples from wal can be understood
* wal decoding into an reorderbuffer
* output plugin infrastructure with 5 callbacks
 * startup
 * begin
 * change
 * commit

Input, Testing and Review by:
Peter Gheogegan
Kevin Grittner
Robert Haas
Heikki Linnakangas
Fujii Masao
Abhijit Menon-Sen
Michael Paquier
Simon Riggs
Steve Singer

Code By:
Andres Freund

With code contributions by:
Abhijit Menon-Sen
Craig Ringer
Alvaro Herrera
wal_decoding: Only peg the xmin horizon for catalog tables during logical decoding
wal_decoding: Allow walsenders to connect to a specific database

Extend the existing 'replication' parameter to not only allow a boolean value
but also "database". If the latter is specified we connect to the database
specified in 'dbname'.

This is useful for future walsender commands which need database interaction,
e.g. changeset extraction.
wal_decoding: logical changeset extraction walsender interface
wal_decoding: pg_recvlogical: Introduce pg_receivexlog equivalent for logical changes
wal_decoding: test_decoding: Add a simple decoding module in contrib

Contains tests.
wal_decoding: design document v2.4 and snapshot building design doc v0.5
wal_decoding: Initial cut at sgml docs section

Andres, Craig
wal_decoding: Temporarily add logical decoding regression tests to everything
slot: hack up pg_receivexlog support

Only for testing/demonstration purposes
Remove TODOs