Query History is now a working feature

Other things that were applied include: code streamlining,
restructuring, and renaming of files.