Partial checkin of rewrite (works on 3.3 only)
Get tests passing on 2.7.
Refactor is_binary_string() to use same code for Python 2 & 3.
PNG special case no longer needed, with new heuristic.
Move less-important API functions into helpers.