Added a generic method to retrieve module settings from the database. First Xml settings are assumed, 2nd json. If the key isn't found a template is added to the database in json format.