Add various new structures and constants. Tidy up formatting a little.