Tests and documentation for Pi