Use last part of dotted main class for target file

See HaxeFoundation/haxe#2332