Refactoring

Restructured XML parsing code
Moved classes around to make navigating source easier