Added toInt(), toUInt() and toDouble() + unit tests