Major restructuring

Split into modules and added IsUserEnabled checking