Fixed a couple of issues in craftingRecipes.cpp

Added a new function for parsing numbers. Its advantages over atoi are that it has bounds checking and can parse any integer type.
Shouldn't `a_str` be a `const AString &`?