Make bigwig work with R16 + latest version of cowboy

This is mainly a refactoring of bigwig to make sure it can run on a recent Erlang/OTP release and works with the latest version of cowboy.