Implemented entity pooling.  Fixes #4