Rewritten k module to load k from external submodule.
Updated to new version of k