Merging with offline version. Added capability for incremental output (-i). Fixed several memory management bugs.