statistical measures ns
cleanups to server main
many extensions and fixes