util.funcs: now with generic Encode(), Decode() functions and StockEncodingOrder.