Added test program and improved documentation.