Added `basis`, simplified `onBasis`

This branch should be merged with its companion -lib branch