Added classes and fixed a lot of bugs. Commits are better described in GordianSE