Move polymorphic_pointer_downcast to a separate header, use pragma once and boost::throw_exception