Improve internal documentation

Reference the PHP manual for stream functions (also add a default
.gitignore file).