Replace forward struct declarations with typedefs

This makes the sources cleaner without all the "struct" stuff everywhere.
I think there are still some left.