IMPORTANT COMMIT - code cleaned up and imporoved

all main functionality moved to common.php and put into functions
rather than multuple pages. Changes to design requested by client. Some
design changes still in progress. Register is broken becuase of added
email field