tests added to interval.py and cleaner code
Some smaller changes needed