C++ compatibility

Only C++ errors are fixed, no functionality changed.

Code now compatible with Visual Studio 2008. I think it's a good chance to increase number of active developers.
In fact, i don't happy with using of non standard types, in base modules and headers first of all.