reorg
use correct identifier/whitespace styles
add typedef machinery