move top-level JS files within directories

Dom directory
State Machine directory