Add getThreadLocalStorage(), major cleanup in svc.h/svc.s