Made Query interface extend Iterable, added test for the most important maintenance commands, fixed some
minor flaws in maintenance commands, mostly parameter checks.