Added parse_period() method.
Tests for period parsing.