Database handling improved for Alternate Gateways

Implemented improvements for proof-of-concept features discussed in issue #60
Tested in a small community deployment. Works reliably.
Needs a crontab job for sending postponed messages. New scripts supplied.
Enjoy! Jan