major rewrite - use applicative style for testinng predicates, add html/css support