ENH: surfcmd writes variable to a text file that matlab can read and interpret. Some other minor changes or refactoring.
REF: computeCentroid function no more a member of logic class.
BUG: surfcmd was not functionning correctly because the Qt console object is not initialized (no GUI). Messages are now logged to the terminal and also to the qt console if it exists.