Major overhaul to the structure, using phi/data.

All layers now get the original images and a functor phi that can
extract the edges from them. By doing this, any layer can choose to
transform the original images and extract the features of all the
different transformations.

The layers also have to manage a pos_matrix. This is probably horrably
different to maintain and prone to errors, but until I have a better
solution for this, we will have to settle for this.