Use STL list for encoding list

This is a lot safer and cleaner. The old code had a fixed size that
we didn't properly keep track of.
3 files changed