Moved some unit tests from the core library to the Magento module

Some of these unit tests are specific to Magento only, even though they
execute core code they belong here in the Magento module's repo.