Alternative approach to avoid having to deal with line separator

Following @skyluc suggestion, I'm now using the Eclipse `Document`
instead of raw text. The huge advantage is that there is no longer a need
for handling the line separator, as the `Document` class already contains
the logic for doing this properly. I find the current solution a definitive
improvement. If you guys agree, I'll squash the two commits.