Produce the layers using the abstract factory pattern for simplicity

"[For me, the lesson learned when writing Caffe as a grad student is simplicity: reduce my problem to one already solved.](https://github.com/Yangqing/caffe/wiki/Convolution-in-Caffe:-a-memo)" -- Yangqing

The factory pattern is on the todo list since the public release of Caffe. As more and more implementations are added, it is time to refactor how the layers are created. 

The theory is not repeated here as there are already [plenty](http://sourcemaking.com/design_patterns/abstract_factory) of [articles](http://www.dofactory.com/net/abstract-factory-design-pattern) talking about the [abstract factory pattern](http://www.oodesign.com/abstract-factory-pattern.html).