Issue 30: Optimizer routine needs tests

fixes #30 
@subutai @scottpurdy Any specific reasons for using these two objective functions (-x2 and sin) for testing?