bugfixed history mechanism

eraseState was pushing an invalid empty state
and viewPanel constructor was trying to switch to historic state
index, even if no view with that index actually exists.
Merge pull request #5 from karger/2013-03-17_bugfix_history

bugfixed history mechanism