Template B-spline

Yet another follow-up of #1. I cleaned up a bit, adapted to the new API, and things seem to be working:

![b-spline](https://cloud.githubusercontent.com/assets/2742231/2678390/412c2b06-c160-11e3-907f-f179f2d3c706.png)

However, I'm sure tests can still be greatly improved.