Support scalar types natively and complex types through ToString()
Added tests for entity factory