Make some inner classes static

An inner class may be static if it doesn't reference its enclosing class
instance. A static inner class uses slightly less memory.