Core algorithms for NuPIC (under construction).