re-arrange internal file structure, squash groupquery redundancy bug.
housekeeping - remove unreferenced/obsolete code