Core logic refactoring.
Added If-Throw precondition assertion.
Implemented a lot of stuff for conversion between different type of preconditions + minor fixes and refactorings.
Synced with other project-files for older sdks.