Added GUI error boxes (functional not pretty).

Also bugfix regarding single constant or single variable expressions. Single variables are now boring but acceptable. Single constants are not valid (this is because they are not a variable nor a step, so a single constant would evaluate to an empty expression which causes trouble). 

Updated invalidate() to reflect this, with minor efficiency improvements too.