Added progress bar and semi-functional querying code.