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.