Fixed wrong expectations and added a new test

Tab ordering expectations were wrong. Added a new test to test starting
from the document as opposed to from the host.
Merge pull request #758 from KenjiBaheux/fixed-tab-expectations

Fixed wrong expectations and added a new test