Refactored shader helper functions

Added printLog function