Authentication token refactored and documented closes #5