Improved tests for building of the table elements.

  The tests are kinda messy, but I'll come back and make things more
  readable later.