Move datatype logic into own directory.