Modularized the code

Separated the Controller, which will contain just the large overview and
the detailed code, which will be in their respective files. In this, we
should have implemented the theta search completely, but it has not
completely been tested.