Fix block extending in parser [see #1010]

This largely reverts #876 which introduced the problem.  It does however
still keep the unit tests and also fixes the problem, just in a totally
different way.
JSON stringify
Ignore newlines in filter tests
Merge pull request #1025 from visionmedia/fix/recursive-extends

Fix block extending in parser