Warning cleanup

- ignoring const
- declarations after statements
- some C files didnt include own headers (risking them getting out of sync)

Closes #1064