Added query.py for BaseQuery class

This PR adds a ```query.py``` module in astroquery for factoring out common functions of different query classes to ```BaseQuery``` as discussed in #110