[lib] Fix version number check

Add function that correctly compares two version numbers, and returns
`=`, `<` or `>`, according to the case.

e.g.:

 * `10.9`     `10.9.0`  =>  `=`
 * `2.1.10.1` `2.2`     =>  `<`
 * `3.2.09`   `3.2.10`  =>  `>`