move detect.js to src/