added check function
Loads of minor changes

Added inheritance, changed log location and fixed a bug that could
happen with stopping the server.