Implement --minimum-memory and --maximum-memory, closes #2
Use last connection protocol in external loop