Move blogreport code behind a __main__ guard

This allows to import from blogreport (without running the code) and
hence allows to the blogreport's functions.

Change-Id: Id98aadda2edbc5715dd7fc8cdeda416a419a560c
Add tests for parsing string to date

Change-Id: I56ccceb6ee624cd75f5f935cc2b7fb9967642944