Reduced memory footprint.

The NestedDbTerm struct was merged with TrunkDbTerm.
When nested LHT is not used truncated versions of RootDbTerm and
TrunkDbTerm structs are allocated.

Cleaned up some code (more needed).

Fixed ets suite's memory test case.

Tested against the emulator, kernel and stdlib test suites.