cleanup deprecated handling for environment
remove additional header dependencys for scriptapi.cpp
add file headers
rename some files