This works for simple cases now. It's something to build on, at least.