Added tests for weight functionality and fixed the bugs found by those tests

Also added code to deal with 1d input arrays for X argument in Earth
methods.