add foreground and background timeout settings

#141
handle timeouts in syncer

closes #141