Moved string->integer parsing logic into library