Reduce repeated code by moving into shared functions

* In following areas:
   - Structure/Unit Auras
   - Tech/Phase Time cost
Change which license this mod is released under.

* I permit this mod to be shipped/merged with core 0AD project
* Resolves #6
Update branch from master
Use newly exposed Engine function to read XML templates.

Clean up of some code. Make code adhere to the coding style.
Support mods with 4 phases.