A Flexible and Expandable Architecture for Computer Games - Thesis with Appendix