Changed order of preference when sending commands to nagios

* Before mk_livestatus was prefered if it was loaded and writing to nagios commandpipe was a fallback
* Changed defaults as supposedly livestatus commands have race condition issues
Unit Tests for macro resolving of a service
Code cleanup, lots of minor bugfixes.
unittest updates
AttributeList is now iterable