Added rules documentation.
Started work on main module.