Cleanup and changed singleton_logp from static
Implement Feature (not tested yet)
bugfix in conversion to function templates