Thesis chapter 4 restructured and UML figures added