Fixing $ in replacement string issue

Missed a second place that replace was called.
Adding a function to take in a layout and a body to be used in the
replacement.
Had to add the function so jshint wouldn't yell about creating a
function inside a loop.

Fixes #286
Merge branch 'master' of https://github.com/assemble/assemble into issue-page-replace-286

Conflicts:
	tasks/assemble.js
Merge pull request #292 from doowb/issue-page-replace-286

Additional fixes