New files for javascript query library

All the new files for query generation, replacing the some of the php
scripts functionality