Fix release publishing.
Made database transactions explicit, per request.
Add tests.