Johanna may be a reference to Faithful Johannes from Grimm's fairy tales. In the story, Faithful Johannes, or Trusty John in some versions, is the faithful servant to an old king who falls ill, dies, and leaves Johannes to care for and guide his young successor. Johannes sacrifices himself for the young king, but the young king in the end sacrifices something precious to save him in return.
The object/animal/person in this episode is the Storybrooke Free Public Library.