fix endless loop when locator.location isn't specified

fixes yahoo/locator#5 by removing the relative path calculation, and uses the basename
to exclude "node_modules" and /^\.+/. Plus some minor style tweaks.

checklist:
- [x] locator tests pass (coverage up slightly because of code removal)
- [x] locator-react example works with "location" removed
- [x] <del>locator-react example works with "location" removed *and* yui-modules dir moved to `examples/node_modules/react-tools`</del> app starts, but this is otherwise non-sensical
- [ ] create fixtures, tests
- [ ] verify against other locator apps