Use traits and enums instead of types for the API.

This commit defines an `Encoding` trait and an enum for each encoding (namely `UTF8` and `Windows1252`). Each enum has a single value and implements the `Encoding` trait.

This gives provides a more usable API as we don't have to use parenthesis to access the `encode`/`decode` methods: `UTF8.decode(...)` works as expected.