module (.mod) parser in javascript