Make functions which do not need to be exported static

Improves linker performance slightly and makes it harder for people to depend on private symbols.