Fixed issue with error propagation

Errors were not being propagated properly to the framework, they would get lost
and never reach the error handler, which left the application in a zombie state.
The connection was left open until the server was killed.
Petit port variable refactor
Refactored Domain module