Initial port to share.js 0.7