Updated query handling, added basic timing, started writing results to file