Exception catching

Make everything pretty, rework the license and add exception catching