Functionally composable cortex, an implementation of Hierarchical Temporal Memory