Reads a prompt from stdin and performs optional validation
read_prompt(prompt, validate = NULL, attempt = 1, max_attempts = 2)
input, or result of validate(input) if validate is supplied
prompt, e.g. "Enter username: "
function input => transformed input if input is valid or, error
current attempt at getting a valid input
maximum number of attempts