refactoring, implementation of cdn's and extraction of libraries from main.js in build