File Restructure

Separated matlab code from c++ mex code.