Hardening: restyled check for selinux; also added functions include file