add load and unload callbacks, allow script to return api
if script returns function, wrap it to table
Merge pull request #2 from Shura1oplot/load-unload-callbacks

bapil: add load and unload callbacks and allow script to return api