Some browsers (IE) does not hold a name property on constructor - some regex magic, courtesy of @bnordli, fixes it