New functionality and bug fixes

Fixed some problems, added error catching and added 3D state diagram
viewer with WebGL