Refactored JS out (and static dir too)