* Split the byte length logic into a seperate method to allow it to be called directly on a string (easier to test and easier re-use) * Added basic unit tests for it.