Simplify type cast rules by assuming input is well-typed
Reorganize test files
Move makefile