New version of st3 branch

Created from current master version. Tested on linux64 and win32.