Fix tests failing on breadcrumbs class

- Better tests
- More defensive coding in breadcrumb class (only needed for the unit tests as in normal circumstances the global post object will always be available)