wip version of makeprofiledb

Hi Peter,

that PR is work in progress. 
Do you agree that we need a new datatype for the profiledb? 

if anyone want to help your are welcome, I'm not sure I will find time the next days.
Cheers,
Bjoern