reimplement module after reimplementing meta compilation

reimplement module after reimplementing meta compilation,
refactor some code in analyze.coffee