Copy madlib before substituting. Fixes #4
Implemented handling of named placeholders. Closes #3.