Ability to edit reference. Big refactoring for bibtext import functions