Extensions and tests

Added various extensions and tests for them.