Cleanup

- minimized includes in headers and sources
- using std:: for C-functions, eg from cmath or cstring
- tiny other fixes