Fixed multiple warnings and errors that blocked c++0x

This allows the server to compile with c++0x (and enables it).
This also includes some coding style / readabillity fixes.