Fix docblocks and copyright info
Update test docblocks and comments
Add functional tests