Trap any unhandled exceptions raised in the main function

This got lost in the conversion.  Now unhandled exceptions will have
their trace printed.
Set source-compatibility with Java 1.6

This essentially declares that our source files are intended to be used
with version 1.6 of the Java language.  It has the nice side-effect of
producing a more sensible error when you try to compile with Java 1.5.
Remove spurious @override annotations

Discovered these when accidentally trying to compile it with GCJ (which
treats these as errors).
Make sure to load tags before manipulating them

Fixes a null pointer exception when deleting rules.
Do not crash when selected vertices disappear

This is a two-part fix; in the core, we deal properly with bad vertices
being given for the attach rewrites command, and in the GUI we properly
remove old vertices from the pick state so that bad vertices are never
given to the attach rewrites command.

Fixes #110
Merge branch 'stable' into integration
Save annotation data for wire vertices

Issue #111
Fix LaTeX (TikZ) output generation

Vertex.getVertexType().toString() would not return the typename, but a
Java magic string, and Vertex.getVertexType() would be null for
wire/boundary vertices, leading to a null pointer exception.

Both these issues are now fixed, by checking for null (and using "wire"
for the type name in that case) and by implement toString() for
VertexType.

Fixes #111
Merge branch 'stable' into integration
Ignore heaps directory
Don't require VData.subst to be same as EData.subst

Everything goes via G.Param for substitution, so VData does not need to
know about EData and vice versa.  The graph Param ties everything
together in whatever way makes sense.
Remove getopt usage in build scripts

This should fix things on MacOS
tempdir hack for os x
Make the tmpdir hack less hackish.

We now replicate the (GNU-only) --tmpdir option in shell code.  This
should work on both Mac and Linux, whether or not $TMPDIR is set.
Expose Rewriter in GRAPHICAL_THEORY
Use shell built-in getopt for option parsing

This should work on Macs because it's basically copied from Aleks' work
in the scala-frontend branch
Merge branch 'integration' into scala-frontend

Conflicts:
	tools/poly-build-heap
	tools/polyc
	tools/polyml-toplevel
moved layouttest from test to main