Add isless, make indexing consistent, add tests
Add unsafe vars, simplify and tidy things