Move save and stop to lib.sh
Add tail arg to log