Fixed handling of singletons in CRSSparsity, enabled caching of constants and empty matrices, #620 #575