Added Query component (not tested yet)
Refactored Match
Fixed exceptions