add tests and fix for stylesheets notifications

Add a couple of unit tests to check stylesheets notifications when ```link``` nodes are added/removed. 
It also fixes this functionality which was accidentally broken on #23 and identified when writing the tests.