extract socos.utils.parse_range()

I've extracted a ``parse_range()`` method into a new ``socos.utils`` module and added some tests.