Fixing maxpooling by using a mask [don't merge]

Now max_pooling use a mask to keep track of the maximum value, don't need to rely on top_layers.

I just rebased and adapted to V1 proto definition but now the test don't pass.