Fix bug where port was returned as a string.
Refactor constants out and into single app