1. Refactored parser code as service so it's more testable.
2. Removed scope from directive to allow $observe to work properly.
1. Added unit tests.