Add a monad to track and generate unique names which is aware of scoping.