diff --git a/password_policy.info b/password_policy.info
index 11e4b32..8a5ceab 100644
--- a/password_policy.info
+++ b/password_policy.info
@@ -5,4 +5,5 @@ core = 7.x
 files[] = password_policy.module
 files[] = password_policy.install
 files[] = password_policy.admin.inc
-files[] = password_policy.theme.inc
\ No newline at end of file
+files[] = password_policy.theme.inc
+files[] = tests/password_policy.test
diff --git a/tests/password_policy.test b/tests/password_policy.test
index 8a73382..584ea7e 100644
--- a/tests/password_policy.test
+++ b/tests/password_policy.test
@@ -7,8 +7,8 @@
 class PasswordPolicyTest extends DrupalWebTestCase {
   public static function getInfo() {
     return array(
-      'name'  => 'Constraints Test',
-      'description'  => t('Assure that password constraints work.'),
+      'name' => 'Constraints Test',
+      'description' => t('Assure that password constraints work.'),
       'group' => 'Password Policy',
     );
   }
@@ -18,6 +18,7 @@ class PasswordPolicyTest extends DrupalWebTestCase {
   }
 
   function testUppercaseConstraint() {
+    module_load_include('inc', 'password_policy', 'constraints/constraint_uppercase');
     $constraint = 2;
     $uid = 0;
     $pass = 'Abc';
@@ -32,6 +33,7 @@ class PasswordPolicyTest extends DrupalWebTestCase {
   }
 
   function testLowercaseConstraint() {
+    module_load_include('inc', 'password_policy', 'constraints/constraint_lowercase');
     $constraint = 2;
     $uid = 0;
     $pass = 'Abc';
@@ -46,6 +48,7 @@ class PasswordPolicyTest extends DrupalWebTestCase {
   }
 
   function testLetterConstraint() {
+    module_load_include('inc', 'password_policy', 'constraints/constraint_letter');
     $constraint = 2;
     $uid = 0;
     $pass = 'a12';
@@ -60,6 +63,7 @@ class PasswordPolicyTest extends DrupalWebTestCase {
   }
 
   function testDigitConstraint() {
+    module_load_include('inc', 'password_policy', 'constraints/constraint_digit');
     $constraint = 2;
     $uid = 0;
     $pass = '1ab';
@@ -74,6 +78,7 @@ class PasswordPolicyTest extends DrupalWebTestCase {
   }
 
   function testLengthConstraint() {
+    module_load_include('inc', 'password_policy', 'constraints/constraint_length');
     $constraint = 6;
     $uid = 0;
     $pass = 'abcde';
@@ -88,6 +93,7 @@ class PasswordPolicyTest extends DrupalWebTestCase {
   }
 
   function testAlphanumericConstraint() {
+    module_load_include('inc', 'password_policy', 'constraints/constraint_alphanumeric');
     $constraint = 2;
     $uid = 0;
     $pass = '1$%';
@@ -102,6 +108,7 @@ class PasswordPolicyTest extends DrupalWebTestCase {
   }
 
   function testPunctuationConstraint() {
+    module_load_include('inc', 'password_policy', 'constraints/constraint_punctuation');
     $constraint = 2;
     $uid = 0;
     $pass = '%1a';
@@ -116,6 +123,7 @@ class PasswordPolicyTest extends DrupalWebTestCase {
   }
 
   function testComplexityConstraint() {
+    module_load_include('inc', 'password_policy', 'constraints/constraint_complexity');
     $constraint = 2;
     $uid = 0;
     $pass = 'abc';
@@ -130,6 +138,7 @@ class PasswordPolicyTest extends DrupalWebTestCase {
   }
 
   function testUsernameConstraint() {
+    module_load_include('inc', 'password_policy', 'constraints/constraint_username');
     $user = $this->drupalCreateUser();
     $name = $this->randomName();
     $result = password_policy_constraint_username_validate($name, '', $user->uid);
@@ -139,8 +148,9 @@ class PasswordPolicyTest extends DrupalWebTestCase {
   }
 
   function testHistoryConstraint() {
+    module_load_include('inc', 'password_policy', 'constraints/constraint_history');
     // Log in
-    $user = $this->drupalCreateUser(array('administer site configuration'));
+    $user = $this->drupalCreateUser(array('administer password policies'));
     $this->drupalLogin($user);
     // Create a policy
     $policy_name = $this->randomName();
@@ -149,58 +159,63 @@ class PasswordPolicyTest extends DrupalWebTestCase {
       'constraint_history' => t('2'),
       'roles[2]' => '2',
     );
-    $this->drupalPost('admin/settings/password_policy/add', $edit, t('Create'));
-    $this->assertText('Policy '. $policy_name .' has been created.', 'Policy '. $policy_name .' has been created');
+    $this->drupalPost('admin/config/people/password_policy/add', $edit, t('Create'));
+    $this->assertText('Policy ' . $policy_name . ' has been created.', 'Policy ' . $policy_name . ' has been created');
     // Enable newly created policy
-    $pid = db_result(db_query('SELECT pid FROM {password_policy} WHERE name="%s"', $policy_name));
-    $constraints = unserialize(db_result(db_query('SELECT policy FROM {password_policy} WHERE pid=%d', $pid)));
+    $pid = db_query('SELECT pid FROM {password_policy} WHERE name = :name', array(':name' => $policy_name))->fetchField();
+    $constraints = unserialize(db_query('SELECT policy FROM {password_policy} WHERE pid = :pid', array(':pid' => $pid))->fetchField());
     $this->assertTrue($constraints['history'] == 2, t('Verified history constraint set.'));
     $edit = array(
-      "enabled[$pid]" => $pid,
+      "policies[$pid][enabled]" => $pid,
     );
-    $this->drupalPost('admin/settings/password_policy/list', $edit, t('Save changes'));
+    $this->drupalPost('admin/config/people/password_policy/list', $edit, t('Save changes'));
     $this->assertText(t('The changes have been saved.'), t('Form submitted successfully.'));
-    $enabled = db_result(db_query('SELECT enabled FROM {password_policy} WHERE pid=%d', $pid));
+    $enabled = db_query('SELECT enabled FROM {password_policy} WHERE pid = :pid', array(':pid' => $pid))->fetchField();
     $this->assertTrue($enabled == 1, t('Policy enabled.'));
 
     // Change password
     $pass1 = "aaaaaa";
     $edit = array(
+      'current_pass' => $user->pass_raw,
       'pass[pass1]' => $pass1,
       'pass[pass2]' => $pass1,
     );
-    $this->drupalPost("user/$user->uid/edit",  $edit, t('Save'));
+    $this->drupalPost("user/$user->uid/edit",   $edit, t('Save'));
     $this->assertText(t('The changes have been saved.'), t("1st password change: $pass1"));
     // Change password second time
     $pass2 = "bbbbbb";
     $edit = array(
+      'current_pass' => $pass1,
       'pass[pass1]' => $pass1,
       'pass[pass2]' => $pass1,
     );
-    $this->drupalPost("user/$user->uid/edit",  $edit, t('Save'));
+    $this->drupalPost("user/$user->uid/edit",   $edit, t('Save'));
     $this->assertText(t('Your password has not met the following requirement(s):'), t("2nd password change should fail: $pass1"));
     // Try changing password with the first one
     $edit = array(
+      'current_pass' => $pass1,
       'pass[pass1]' => $pass2,
       'pass[pass2]' => $pass2,
     );
-    $this->drupalPost("user/$user->uid/edit",  $edit, t('Save'));
+    $this->drupalPost("user/$user->uid/edit",   $edit, t('Save'));
     $this->assertText(t('The changes have been saved.'), t("3rd password change should pass: $pass2"));
     // Change password again
     $pass3 = "cccccc";
     $edit = array(
+      'current_pass' => $pass2,
       'pass[pass1]' => $pass3,
       'pass[pass2]' => $pass3,
     );
-    $this->drupalPost("user/$user->uid/edit",  $edit, t('Save'));
+    $this->drupalPost("user/$user->uid/edit",   $edit, t('Save'));
     $this->assertText(t('The changes have been saved.'), t("4th password change should pass: $pass3"));
 
     // Delete test policy
-    $this->drupalPost('admin/settings/password_policy/delete/'. $pid, array(), t('Delete'));
-    $this->assertText('Password policy '. $policy_name .' was deleted.', 'Default password policy '. $policy_name .'was deleted');
+    $this->drupalPost('admin/config/people/password_policy/' . $pid . '/delete', array(), t('Delete'));
+    $this->assertText('Password policy ' . $policy_name . ' was deleted.', 'Default password policy ' . $policy_name . 'was deleted');
   }
 
   function testDigitPlacementConstraint() {
+    module_load_include('inc', 'password_policy', 'constraints/constraint_digit_placement');
     $constraint = 0;
     $uid = 0;
     $pass = 'ILove2Password';
@@ -255,14 +270,14 @@ class PasswordPolicyForcePasswordChangeTestCase extends DrupalWebTestCase {
     // no perms
     $user = $this->drupalCreateUser();
     $this->drupalLogin($user);
-    $this->drupalGet('admin/settings/password_policy/password_change');
+    $this->drupalGet('admin/config/people/password_policy/password_change');
     $this->assertResponse('403', t('Acces should be denied.'));
     $this->drupalLogout();
 
     // with perms
     $user = $this->drupalCreateUser(array('force password change'));
     $this->drupalLogin($user);
-    $this->drupalGet('admin/settings/password_policy/password_change');
+    $this->drupalGet('admin/config/people/password_policy/password_change');
     $this->assertResponse('200', t('Access should be granted.'));
     $this->drupalLogout();
   }
@@ -272,7 +287,7 @@ class PasswordPolicyForcePasswordChangeTestCase extends DrupalWebTestCase {
     // test admin form
     $user = $this->drupalCreateUser(array('force password change', 'administer users'));
     $this->drupalLogin($user);
-    $this->drupalGet('admin/settings/password_policy/password_change');
+    $this->drupalGet('admin/config/people/password_policy/password_change');
     $this->assertFieldByName('password_policy_new_login_change', '', t('Found first time login change checkbox.'));
     $this->assertFieldByName('password_policy_force_change_roles[2]', '', t('Found roles checkboxes.'));
     $this->assertFieldById('edit-submit', '', t('Found submit button.'));
@@ -300,7 +315,7 @@ class PasswordPolicyForcePasswordChangeTestCase extends DrupalWebTestCase {
     );
     $this->drupalPost("user/$user->uid/edit", $edit, t('Save'));
     $this->assertRaw(t('!user will be required to change their password the next time they log in.', array('!user' => $user->name)), t('User flagged for password change.'));
-    $force_change = db_result(db_query('SELECT force_change FROM {password_policy_force_change} WHERE uid=%d', $user->uid));
+    $force_change = db_query('SELECT force_change FROM {password_policy_force_change} WHERE uid = :uid', array(':uid' => $user->uid))->fetchField();
     $this->assertTrue($force_change == 1, t('Force change flag set to %d for %s.', array('%d' => $force_change, '%s' => $user->name)));
 
     //confirm admin can edit user account without changing password
@@ -310,7 +325,7 @@ class PasswordPolicyForcePasswordChangeTestCase extends DrupalWebTestCase {
       'force_password_change' => 1,
     );
     $this->drupalPost("user/$user->uid/edit", $edit, t('Save'));
-    $force_change = db_result(db_query('SELECT force_change FROM {password_policy_force_change} WHERE uid=%d', $user->uid));
+    $force_change = db_query('SELECT force_change FROM {password_policy_force_change} WHERE uid = :uid', array(':uid' => $user->uid))->fetchField();
     $this->assertTrue($force_change == 1, t('User force change flag set in database:%s.', array('%s' => $force_change)));
     $this->assertNoRaw(t('An administrator has required that you change your password. You must change your password to proceed on the site.'), t('Admin can edit user account without changing password.'));
     $this->drupalLogout();
@@ -323,6 +338,7 @@ class PasswordPolicyForcePasswordChangeTestCase extends DrupalWebTestCase {
     // attempt to change password
     $edit = array(
       'mail' => $user->mail,
+      'current_pass' => $user->pass_raw,
       'pass[pass1]' => 'random_string',
       'pass[pass2]' => 'random_string',
     );
@@ -345,14 +361,14 @@ class PasswordPolicyForcePasswordChangeTestCase extends DrupalWebTestCase {
     $edit = array(
       'password_policy_force_change_roles[2]' => 2,
     );
-    $this->drupalPost('admin/settings/password_policy/password_change', $edit, t('Submit'));
+    $this->drupalPost('admin/config/people/password_policy/password_change', $edit, t('Submit'));
     $this->assertText(t('Users in the following roles will be required to immediately change their password: authenticated user'), t('Authenticated users role selected.'));
     $this->assertTrue($admin->uid != 1, t("Admin uid not 1: $admin->uid"));
     $this->assertRaw(t('Your password has expired. You must change your password to proceed on the site.'), t('Admin (not uid 1) correctly forced to change password.'));
     // test db flags for individual users
-    $entry_1 = db_result(db_query('SELECT uid FROM {password_policy_force_change} WHERE uid=%d', $user1->uid));
+    $entry_1 = db_query('SELECT uid FROM {password_policy_force_change} WHERE uid = :uid', array(':uid' => $user1->uid))->fetchField();
     $this->assertTrue($entry_1 == $user1->uid, t("Entry created in password_policy_force_change for user $user1->uid."));
-    $flag_1 = db_result(db_query('SELECT force_change FROM {password_policy_force_change} WHERE uid=%d', $user1->uid));
+    $flag_1 = db_query('SELECT force_change FROM {password_policy_force_change} WHERE uid = :uid', array(':uid' => $user1->uid))->fetchField();
     $this->assertTrue($flag_1 == 1, t("User $user1->uid flagged: $flag_1."));
     $this->drupalLogout();
     //test individual users
@@ -375,7 +391,7 @@ class PasswordPolicyForcePasswordChangeTestCase extends DrupalWebTestCase {
     $edit = array(
       'password_policy_new_login_change' => 1,
     );
-    $this->drupalPost('admin/settings/password_policy/password_change', $edit, t('Submit'));
+    $this->drupalPost('admin/config/people/password_policy/password_change', $edit, t('Submit'));
     $this->assertRaw(t('New users will be required to change their password on first-time login.'), t('New users required to change password on 1st login.'));
     $this->drupalLogout();
     $user = $this->drupalCreateUser();
@@ -399,6 +415,7 @@ class PasswordPolicyForcePasswordChangeTestCase extends DrupalWebTestCase {
     $this->assertRaw(t('Your password has expired. You must change your password to proceed on the site.'), t('Admin forced to change password once they try to leave account page.'));
     $edit = array(
       'mail' => $admin->mail,
+      'current_pass' => $admin->pass_raw,
       'pass[pass1]' => 'fpcR@nd0m!',
       'pass[pass2]' => 'fpcR@nd0m!',
     );
