Move prolog results into the correct package namespace after querying