Added C++ guards to .h files.
Fixed numerous C++ warnings and errors.
Merge branch 'v0.36'