Merge pull request #2 from damucz/master

memory leaks
Fixes issue with visual studio not defining M_PI in math.h. Fixed all compiler warnings.
Merge pull request #6 from seoushi/master

Visual studio and warnings fixes.