Assigning imported callbacks to handlers, move type-checking into anm.js

Hook imported callbacks to a corresponding handlers
Move type-checking to anm.js
Wrapping handlers into provided wrappers
(some console.logs just for fun)