More logging

Mostly ported `LogTransaction` stuff from https://github.com/metabrainz/metabrainz-server/blob/master/lib/MetaBrainz/Data/Donation.pm.