Add a decode() function that looks for a BOM.

Only works with a single string entirely in memory.

This is part of #19, although complete #19 would also support incremental decoding.