Added QMatch class, major bug fixes