Delay survey submissions

For issue #37. This queues survey submissions and tries resending them if there's a problem with Internet connectivity. @christhompson had landed some starter code; this goes the last mile and gets it working.
|transaction| isn't used. Also, what happens if db.transaction fails? Do you get an exception? Might want to wrap it with a try / catch block.