Added query class and Initializing

Query class for simpler database queries