A more generic way to create URL based template

    - As mentioned in issue 17, the method used assumes
      that the lookup field is 'pk', but this in fact can
      be anything. This fixes that issue.
      Another issue with the 'reverse¡ approac was that it wouldn't
      match ids which must include dashes or underscores, this
      takes care of that as well