You could use mimetypes for that, but they won't always give an expected result. For example, you list .py-files as unreadable, but their mimetype is text/x-script.python.
" non-directory with a mimetype starting with "text/"
fileviewer {*[^/]}<text/*> text-file-handler
" non-directory with a mimetype not starting with "text/"
fileviewer {*[^/]}!<text/*> non-text-file-handler