Prefer Long over DLong as a method return type

Methods like `TxReport.resolve`, `DDatabase.entid`, and `DEntity.id` should prefer Long over DLong as the return type.

pattern matching for queries should also extract the primitive types:

```scala
queryResult map {
  case DLong(e) => …
}
```
should be preferred over
```scala
queryResult map {
  case e: DLong => …
}
```