Refactor to modules

All modules separated. Unstable modules dont compile