Gradle build fixes

- Use -all distribution
- Move remaining Groovy tests to proper source dirs
- Add Derby dep to core tests
Use H2 for database tests
Attempt to slightly reduce item-item memory use

- Make it possible to build a vector from a scored ID list builder
- Use scored ID list builders instead of hash maps for building item-item contexts
Support compact key domain storage

- Make key domain tests dynamic, test outside range of ints
- Abstract storage of key domains
- Use int[] to store key domains if the values are small enough
Support iter-based key domain creation internally
Copy side channels into vectors
Add local.gradle support
Import IntelliJ IDEA configuration.
Include buildSrc in IDEA configuration
Clean comments.