Add mergeProfile to profile.js

This roughly completes profile.js