Move shared bot code into a new Wikidata class

and create entities if not found