Extended configurability.

Added a couple of configuration options.

This is split into two commits because:

a) I forgot I needed to update the Swig version. 
b) I edited the swig.js in GitHub because my editor auto-formats and would have stripped a lot of whitespace (and I am too lazy to shut it off).