Implemented MFModel.

Changes
1. Implemented MFModel.
2. Move C-functions from MFCommon to MFCoreFunctions.