add lib/snippet/common.js; fixes #7