Add some code for initial Galaxy support. Rewrite and move code around in preparation for GOG Galaxy API support.