Bindings generator refactoring and improving: almost handles callbacks and doesn't crash.