Updated structure of js files and fixed some browsing issues