Implements history command