Removed code duplication by refactoring out a createReferenceText-method being capable of dealing with native libs.
Documentation added.