Add revision to `brew info --json`

Closes #27820.
Don't rely on Dependency#to_s
Simplify collecting options