Fixed some of the file parsing.

A few typos related to handing off filenames instead of file objects.
Added the actual link rewriting code.

Also traverses the text of nodes and rewrites any instances of the old
links with the new ones. By default, names everything by its previous
absolute path prepended with '/tmp'.