Removed undefined behaviour and bare new

-Chaged 'new' with std::make_shared< T >(...) which allocates memory for
the object T and the control blcok with a single allocation ( new uses two ) for more info : http://en.cppreference.com/w/cpp/memory/shared_ptr/make_shared

-Added else before' ++p;' in update balls for loop. Previously the
iterator was changed twice when a ball was deleted, potentially leading
to undefined behaviour. This should fix the segmentation fault that has
occured earlier and remove the need to check if (*p) is nullptr