Fix template references

A `filename` key is needed in the options passed to `precompile()` in order for `extends`, `include` and `import` to work in templates.

I also passed the merged options to `precompile()`, though I'm not really sure what the point of merging them is in the first place, since Swig doesn't use `toFile` AFAIK.