Initial import from scodec and removal of dependencies