Replaced response_expand with BSD-licensed reimplementation.

Cleanup to follow later.

GitHub: Fixes #267.
Merge pull request #350 from klickverbot/oss-response-expand

Replaced response_expand with BSD-licensed reimplementation.