Major documentation improvements (mostly grammar etc.)

Some small and insignificant source code changes, like typedef types
instead of explicit ones etc.