gaedatastore: create_class() now static so can use in shell. Cleaned up build_query() so it looks less stupid.