Move authentication code to MCAuthLib