refactor javascript and add admin script

refactor javascript to move init script into container it self