move decoding tools into user_types.py

as pointed out to me, there's not any real need to separate these functions
since they are just going to be used for user types.