Added status led and direct port access; general code cleanup