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.
Merge pull request #499 from naoliv/pull22

Make some inner classes static