Better control over line endings

I used JMustache to generate Java source files (see attached test case). When output is not HTML we need better control over line endings and whitespace. In this patch the parser tries to guess the line ending by looking at the first line terminator in the template. Once the line terminator is known, processing continues as usual, but there's a more sophisticated handling of whitespace surrounding section tags. Consider the following template:

```
1. public class SomeClass {
2.     public void myMethod() {
3.         {{#statements}}
4.         {{.}}
5.         {{/statements}}
6.     }
7. }
```

With this patch we want to completely get rid of the text surrounding section opening and closing tags when it's appropriate.

Test cases provided (also committed Intellij IDEA shareable files)