Added version flag support and moved flags to init