Add revision detection

rev. A = 1
rev. B = 2

Addresses issue #20 and #8.