Mostly cleanup, faster comparisons.

No more string comparions to check for types, generic version of ByteArrayToObject does conversion.