Refactored options handling into a separate class

for reuse with the grunt task