Use LooseVersion to do proper version checks

This handles versions like 1.9a and 1.10