Minor refactoring
Move command-line options parsing to Main
Export sproxy as a library