Fixes to code organization, get passport working correctly