more history stuff

from: http://superuser.com/a/664061/49388
- different file for history
- write to history after each command
- function to stop recording