Update codec

Main changes:
- Revert codec creation.
- Update indexed management.
- Add generation of frame header.
Merge pull request #20 from hruellan/master

Update Codec.