moved ports and listening out of nox-appserver
added useBefore()
pass requirefun and logfun to appserver