fixed many typedefs to be CapCase
fixed compile error and more sed replaces for typedef names
fixed all compile errors