Adapt the data interface from CXXNET authored by @tqchen & @antinucleon

One of the flexible features of CXXNET is that the data interface is easy to extend and relatively independent of the preprocessing steps. The design is a natural solution to partly solve #148. 

The commit bcf933b literally translates the codes of CXXNET into the Caffe terminology. There are concerns about the copyright and the license that must be addressed. I would like to reach out to @tqchen and @antinucleon to get their permissions to adapt their codes. I believe the Apache License Version 2.0 under which CXXNET is licensed is [compatible with](http://stackoverflow.com/questions/40100/apache-license-vs-bsd-vs-mit) the BSD 2-Clause license under which Caffe is licensed.

The API is ready for code review. The concrete implementations will follow when the API is stabilized.