Started module framework, a little refactoring

Seriously, p is not a variable name >.<