Fixes #35; Adds query class