Added query creation

Also fixed a small bug for checking madlib version inside of madlib.lm,
     madlib.glm, and madlib.summary