Add programmtic interface

I found myself really wanting a programmatic interface to check strings without having to write to files. This is a simple function for doing so.
Seems reasonable - this was my 'change as few lines as possible' first pass.