API for various compression codecs

First draft of API.
@trustin and @normanmaurer please review it.
check if the promise is still not done first as it may be done in the meantime.