Unit tests for LESS/SCSS

Also fixes for #8894 and #8895.
I moved out these two functions from `findSelectorAtDocumentPos` scope to the module scope so that I can call `_getSelectorInFinalCSSForm` from other function in the module. The only change that I made in `_getSelectorInFinalCSSForm` is `ps = cs.replace("&", ps);` --> `ps = cs.replace(/&/g, ps);`.