FErari: an Optimizing Compiler for Variational Forms