Calculate one instance usage per transaction.

This prevent increasing the memory usage due to huge workflow history.
some whitespace/indent changes to please pep8
Prevent calling instance bang too often when not needed.
make pep8 happy
removed logger parameter from Interface constructor (for serialization)