making a bunch of functions static

As an added benefit, gcc now warns that a lot of these functions are
never used.