Added command line option to generate heap dumps

If a test generates an OutOfMemoryError, a heap
dump will be generated that can be used to determine
the root cause.

See http://docs.oracle.com/javase/7/docs/webnotes/tsg/TSG-VM/html/clopts.html