tests: Add tests for Buffer.
buffer: Refacor the basic buffer.

This change improves the read/write perfomance of Buffer
by at least 100x and eliminates a nasty performance hit when
large ringbuffers are used.

This often caused unnecessary cache drops in players since
the reads could become very slow if the buffer had grown a bit.
Change default ringbuffer size to 16MB.

This helps performance on segmented stream types and
VOD's where it's common to be able to access data faster
than needed.

By allowing more data to be stored in the ringbuffer we
will have less cache drops in the player when we encounter
spikes in the download speed.
crunchyroll: added an extra check for invalid credentials
crunchyroll: changed instances of e.message for e.args[0] due to incompatibilities with python3
Merge pull request #272 from asermax/crunchyroll-credentials-fix

Added an extra check for invalid credentials
Merge remote-tracking branch 'upstream/develop' into develop