[WIP] Fix and Update Behat tests

In this PR I have added several behat tests, fixed a few broken tests and made several bug fixes that were discovered during these tests.

The following needs to be done before this PR can be submitted:

- [ ] Investigate and fix failures in features/generate-documentation/options/LimitElementsBasedOnVisibility.feature