Add tests for access rules middleware.
Improved documentation.
Update doc build script.