use reflection to check if class is instantiable

fixes #3, thanks @gvdvenis