ERP-116

Transaction and stack based publishing so that only the top level of the delay_messages method will publish.