Merge pull request #4 from Kadish/master

Fixed a divide by zero error.
Minor changes - allow runtime modifications to simulation. (restart/exit)

Eventually will have "addtarget" etc params.
merged with upstream