move resolver to separate factory
separate templatemapresovler and templatepathstack to new factories
remove unused logic
add some docs
fix formatting style