Fixed module declaration bug, added module.extend