added rough TypeDef resolution, structs, cleaned up dead code, eliminated most warnings