Since getting the ostype is used multiple places I made a function for it and modified the existing code to use said function. I also added tests for the function. Signed-off-by: Sandon Van Ness <sandon@inktank.com>