Added a separate setup function

It initializes and tests the uart, gpio and wait routines.