Add port0 server test and small refactoring of lib/dnode/init