add standalone option to run embedded router
review and refactoring
adjust example