Moved around some definitions to avoid scala compiler issues with proguard and added a simple main method