Got a first draft of pooling working. Fixes #49.