Basic UDT implementation. Lots of bug fixes.