Make links in prm clickable, extract files

Not all of the code is extracted yet, but I think this is worth merging right now anyway.