Fixed memory leaks, prepared visual studio projects for safe redistribution