Major revision

- Properly connects to temp DB
- Work done to implement query->DGV function
- Misc changes