separate js files to core.js, add support for mongodb and gridFS to store files