Optimizations and speed improvements added.

Finished optimization true|false categorization for structs,
also did size optimzations so the template should run faster.