Refactor to make external function use the message bus to add an external layer

See conversation here https://github.com/aodn/aodn-portal/commit/731b48b51ca5c7b24dd3dc7e5287fb907ca66dfe
Cleaned out some console.log statements