Add method to formulate permalink; closes #20

Also changes way permanent_id is indexed so that it is not multivalued.