test: Don't use inline if/else syntax

Looks like python-2.6 doesn't understand it
Merge pull request #330 from euroelessar/lts

test: Don't use inline if/else syntax
tests: fixed pyton indent
tests: fixed python formatting
Monitor: Added REST-like api for getting monitor statistics.