split .js and .cc code into separate files