Typedef'd structs.

- added typedefs for all structs
- fixed some compiler warnings