Added role factory with auto registration. Added separate main file