Unit tests for LESS/SCSS

Also fixes for #8894 and #8895.
@ingorichter Can you address all the comments for this file?