More selectors supported

Support for more advanced CSS-like selectors. Major refactor.