Added log rotation feature

A new configuration variable "log_rotation" is introduced to enable log
rotation. The default value is 5 meaning that 5 rotation log files will
be used like so:

build/build.log
build/build.log.1
build/build.log.2
build/build.log.3
build/build.log.4
build/build.log.5

The oldest log file is build.log.5 and the latest is build.log .

Logs are rotated every time the build command is used.