Refactor node route logic into a controller. Also fixed a bug with passport serialization.