Implement new C++ data structure to power algorithms

WIP

Starts #216.
Obsoletes https://github.com/numenta/nupic.core/pull/217.
Do we expect clients to call these methods? If not, they should have a trailing underscore in the name.