Drop external build-dep on `containers`

This is an attempt to address

  https://github.com/haskell/cabal/issues/1811

by ripping the less than 100 lines of code actually used from the
containers package into an internal non-exposed `template-haskell` module.

Moreover, `template-haskell` does not expose the `Map` type, so this change should
have no visible effect on the public API.

Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>