Move bunch of getidxbyname method calls into its own env.
Implement counters:

- ncmds_rcvd
- ncmds_succd
- ncmds_errs
- ncmds_repld

- nsess_created
- nsess_destroyed