refactoring, bugfixing, stability improvements, implementations for Docear/HTW-Frontend#685