New version of code works with Scala runtime.
Functional avector is now working, but still runs slowly.
Still working on runtime.