improved code and documentation of KrawczykCSS
added safeCast() to Krawczyk