Remove dead code just added

That dead code is for a more robust approach, so I'm preserving this approach in
history on purpose.
Fix template parser - allow for trailing input without failing the parse
Refactor to expose a subfunction
Fix symlink creation check: use the template for binpath (actually fix haskell/cabal#1452)
Cope with dangling symlinks in the binary directory (haskell/cabal#1009)

canonicalizePath on a dangling symlink throws a DoesNotExistError. Because of
this error, cabal-install thinks mistakenly that no file is in place, and then
it tries to create a new symlink without removing the existing dangling one. The
result is an `already exists` exception:

cabal: ../ghc-7.6.3/lib/bib2cms-0.0.0.0/bin/bib2cms: already exists
Fix template parser - return trailing unparsed input & update testsuite

Returning the trailing unparsed input allows the caller to decide whether it is
interested, and allows the testsuite to better check the results.

This also makes the patterns less greedy at the end, but this is not a real problem.
Fix typos