Fix #line directives and rework REST examples. Fixes #628.