Fix generated server template files: fix #307

Fix signatures of constructors
Add template implementation of virtual funcitons
Remove "DO NOT EDIT"