Add more tests to check min/max works in more cases.
Move compiler file functions to compiler from cli.