split scriptapi.cpp
remerged some files in order to reduce number of additional files
Make necessary changes for split, rename files, reorganize some bits