Add support for partials with context; cleanup