Remove unnecessary declarations of static functions

These functions don't need to be declared in advance at all.
Declare static functions within the file they are used/defined in

It does not make sense to declare but not define static functions
in a header.
Merge pull request #307 from mstorsjo/cleanup-static-func-declarations

Cleanup static function declarations