basecurve tool: allow easy compilation of optimized binary
basecurve tool: make some functions static, move usage to own function
basecurve tool: single exit point in main to avoid leaks in error paths
basecurve tool: add license header