The formula interface for layer functions

According to @hadley, for the formula case we need `eval(x[[2]], data, environment(x))`. I think the whole advantage of using the formula syntax is that we can take advantage of `environment(x)`.