Add getopts + simple function

Start adding a bit of infrastructure to allow flags and options to the interpeter