stbt.py: Cleanup: Extract image processing into "_match_template" function

This makes the control flow of "detect_match" easier to follow.
stbt.detect_match: Obey the "timeout_secs" parameter

We were forgetting to pass it on to "Display.frames".
stbt.detect_match: Implement confirm_method="normed-absdiff"