Refactored functions out of controller class so they can be reused.

TODO: convert to a class.
Stubbed out the rest classes
created generic bean search query methods.
find_beans method takes in list of modules, stop_on_find.

Frontend needs to get updated to new model.
Code isn't working at this point.  Various REST refactorings and test client added
Cherry Picked: Calls closed before call ended fix, and N? dialstring fix for pots.

Manually cherry picked two important changes that were made in RG_DEBUG branch.
Fix for when CallerID is blocked.

No longer tries to find contacts in asteriskLogger if the phone number (once all characters are replaced is < 5).
Fix for when CallerID is blocked -- Prev commit only handled Account search.
Fix for magic dial buttons & popups = Always on

When Hogan merged his branch in he removed these guard expressions.
Fixed 2 bugs in FakeCall

- Timezone is set to UTC now properly.
- Create 2 contacts wasn't working.
- Added instructions
Fixed bug with BLOCKED
Fixed bug where dropdown items couldn't be disabled

Bug was css wasn't hiding them + My jquery selectors to show() were also wrong.
If phone_fields are empty in config, we don't bother doing a search.
Compiled the template
Removed an extra div tag which caused IE8 issue.
Fixed bug where multiple transfter dialogs appear.
Debug logging - v3.3.6
Merge branch 'V3_PotsEnhancements' into Callinize_RG_Debug

Conflicts:
	SugarModules/modules/Asterisk/asteriskLogger.php
	SugarModules/modules/Asterisk/include/controller.php
	manifest.php
Merge remote-tracking branch 'origin/Callinize_RG_Debug' into Callinize_RG_Debug