Split code into modules

For integration into other web sites.