Move misplaced pixel format function declarations and rename some.
Move bitmap pixel manipulation to separate file.