Improved logging
Updated for GnuCash 2.6.x

Note this commit breaks compatiblity with GnuCash 2.4.x. I have created a new
gnucash2.4 branch from the last version that worked with GnuCash 2.4.x. I do
not plan to continue development on it but I will consider pull requests.