Rewrite of bibtext import/export