Extracting shallow clone to shallow clone.js

This builds on top of #124.