Add documentation for stream handles
Move some type definitions to misc section