Added some exception handling and logical processor counting
Still have a lot of work to do here. Need to revisit my implementation of Lloyd's algorithm and build the template versions of those function here.