Remove Autopublish/insecure, add publish/subscribe code