Separated some code into functions.
Initial commit of imstat_box.py