Add serialize methods to static types