Better version detection

This is how we do version detection in JBoss Modules now; I plan to make this method ubiquitous.