Put the stuff together and enhanced ZX-128 support

Taken almost unchanged from Alex's branch except putenv() now has an extra check and TTY limit reduced on ZX-128.