Create main.js

Adding the once function that exposes the desired functionality to the global scope