Update for Issue #7 and #5 - common.js and encoding