toplevel: fix the toplevel script (Core API change)
Math: port `histogram` to Core