Cleaned up example, generalised output buffer parameter and improved return types on get_stream_read/write_available.

This PR changes the return type of `get_stream_read_available` and `get_stream_write_available` from `i64` to `Result<Option<Frames>, Error>`. It also attempts to make the example a little more idiomatic while fixing a couple errors.

Closes #30