Fix mixed tabs/spaces and trailing whitespace
Remove unused variable and unused method

Method was actually used but only for this unused variable.
Remove unused variable
Remove debug output

A library should not print to stdout.
Major refactoring

Extract methods here and there, simplify some expressions. Seems more
succinct to me. Also, more testable this way. Some tests included.
Use XML builder

WIP to add nested tags in raw notifications.
Add ability to use multi-level hash in raw notification