Issue #154: Convert taxonomy objects into real classes

PR for https://github.com/backdrop/backdrop-issues/issues/154

Based on these two patches from drupal.org:

- https://drupal.org/node/1361232 (main issue)
- https://drupal.org/node/1550454 (fixing EFQ which was broken by the first patch)