Background Unit Test

Wrote a unit test for the background changing function (also modified
said function slightly to make unit testing easier).