refactor: changes library architecture, splits code into various APIs.

The biggest refactor of the library yet!

This also includes the experimental extendable array creation code, yet to be tested!!