Parser: Cleaned up some code for the queries and fixed some (not all) issues with returning tokens to the stream for parsing