Fix beginningOfWeek method and add some tests

The current implementation of beginningOfWeek doesn't seem to work. This fixes that method, as well as adding some basic unit tests for all the methods.