Fix preserve no extra newlines setting in webpage.
Replace inaccurate output wrapping tracking with statement tracking

Fixes #314
Fixes #413