Refactored selector.js
Passing all selector specs