Set exit status correctly

To better allow testing of this, I took the matching logic
out of the ansible-lint script and into the library.

Added test cases, ran test cases and examples, all seems to work