split functions.js into seperate files