added test to support #2, switched to using nose for tests, formatting tweaks