cleanup and fixes. now StringModel class with platform-independent core