moved stream allocation to it's own class, moved everything to a cql namespace, created an error type instead of just error codes