format: changed most exceptions to IAE

shit should break where it breaks, not at some nullpointer far away.
(and we can test it oh yeah!)
test: added negative type/conn/query test