add hooks framework and add hook for portal added (fixes #87)