various extern cleanup + api history uids and gpu SM

uids could be useful to create graphes from history data

Note: please do a clean build after this commit (changes in miner.h)