Third time for replicate()'s a charm:
  since I cannot sanely run replicate() from within the DB, write it as a script
  as I was always meaning to
  But still use basically the same code as the second attempt,
  including sleeping on a changes socket and requiring the co-operation of stored procedures.
replicate_register()

This seems to behave properly, but I can't really test it fully until the whole system is together.
Code cleanups
Enable SQLAlchemy streaming
Move watch_table() into the same file as the rest.

Plus some cleanups like changing the order of args and adapting watch() to use the table-trigger trick.
and stub out (untested!) the final broadcasting over unix domain sockets.
Datagram unix domain sockets are being finicky, so import a known-good example I found on a blog.
replicate_broadcast()

Broadcasting changes works now!

There's a glitch, because DBs are full of state and that makes things difficult:
 - when reloading replicate.pysql, old watch_table() triggers stick around.
Reliability fixes

1) tolerate missing listeners
2) instead of trying to manage unique trigger names, use a fixed one ("watch_table" the trigger executes "watch_table" the function) and avoid the ugly conflict that happens when the replication code is reloaded overtop of a live database by summarily dropping the previous one; However, this summary execution only occurs the first time register() is called per load of replicate.pysql, so its impact should be minimal
move some code I missed moving when I split watch.psql
Stop replicate.py hanging postgres

This one was ugly; something about the way SQLAlchemy handles selects--which "select funcname()' is, syntatcially--was creating a secret transaction that I can't figure out how to access (C.in_transaction() claims I'm not, too)
So, this had all sorts of bad results, like, sometimes an insert from another session would hang (but only sometimes)
I just spent a while with a psql session open simultaneously with a sqlalchemy (-via-ipython) session, going back and forth doing inserts and selects on both sides, until I noticed it was sqlalchemy's writes that weren't going through, and then only those writes created within stored procedures.
Wrapping functtion calls in an explicit transaction seems to have solved this.

Also, standardize on utf-8 for IPC.
Switch to a cleaner way to manage mutating selects.

..of course, the SQLAlchemy docs explained what I just spent 2 hours figuring out.
Link is embedded in this commit.