Refactor javascript dependencies to use WebPack