Reorganised project srtucture. Added long mode detection.