Cleanup MatchQuery

I cleaned up MatchQuery a bit and simply moved the IOException up one level. It won't happen unless there is something horribly wrong and then we should throw anyway.