Refactor and added marc4js.js with test cases