feat(demo): switch host with DEUCE_HOST env var

Also refactor common code of demo into a header.