smalloc: initial smart memory allocator

Other classes that require external memory should allocate it though
smalloc. This will simplify creating general performance improvements
and debugging for things like memory leaks.

Inputs are validated from cc so the module is safe for user-land, and
several tests have been added to make sure it operates normally.

External memory allocations have been hooked up to the HeapProfiler so
they can be viewed by modules like heapdump.

The module can be accessed directly through require('smalloc').