Use last part of dotted main class for target file (closes HaxeFoundation/haxe#2332)