Clean up name and arg parsing, export NameAndArgs function
Prevent panics when input is wrong type (return an error instead)