removed useless debugging messages
fixed potential bugs when handling portal data from callback
initial version of export feature.

It works... more testing required.