Move ws, home declarations outside handler

Move ws, home declarations outside handler to avoid runtime dependencies. If there is an issue with either of these it then gets flagged on server start instead of waiting until the route gets called.
Merge pull request #1 from johnbrett/patch-1

Move ws, home declarations outside handler