Example how to create self contained JS library