Some refactoring.
Added MADOKA_OVERRIDE macro.
Changed to pass the buffer to callback functions.