Fix nth-child bug

There was a problem with the way you were doing the nth-child thing. 
nth-child filters for elements that are an nth child. e.g:
	
	results.filter(function(el){
		return el.parentElement.children[n] === el
	})

this meant that if not all element siblings shared the same classlist
etc.. you would end up with an incorrect selector.

The later commits are just general tidying up and optimisation.