Extend the factory to return an interface instead of object to allow for extending message publication

The default factory does not permit extending the MessagePublication object. This changes it to an interface. Also added were various directories to .gitignore