More documentation; also added proper support for optional matching.