Move interval parsing function into own module.