Add some conditionals for non-flash and nme

Remove some imports that are not used on non-flash targets.  Also, allow compiling with NME (as distinct from openfl) with a few small conditionals.