Adding a generic spin function and new step definition for waiting for content to appear in the context