Added constructor that passes in state

init() function in module is now optional, not required