moved outstream debugging, formating etc. to global.h from modelglobal.h
fix constant assumption and some warning building with msvc.
build base libs as static