Fix multiple instances bug

closes #28
- added stopdone to wait for server to stop
- renamed done to startdone
- added testsequence which is able to reproduce the bug without my changes to server.js