Optimized transaction.py a bit more

- sum over iterator, not list
- list comprehensions are more pythonic than map(lambda)
- increased readability of some fragments
- filter(None) removes None elements

More optimizations will follow gradually.